import { Scene } from 'three';
import { AirLabel } from './libs/airLabel';

export default function createLabel(scene: Scene): any[] {
  const labels: any[] = []
  const labelData = [
    {
      text: '铜官数谷',
      position: [-43, 28, -7],
    },
    {
      text: '建设银行',
      position: [23, 12, 8],
    },
    {
      text: '安徽农金铜陵皖江农村商业银行',
      position: [35, 12, -20],
    },
    {
      text: '安徽农金铜陵皖江农村商业银行',
      position: [35, 12, -20],
    },
  ];

  labelData.forEach(item => {
    const label = new AirLabel({
      ...item, 
      font: {
        fontSize: 16,
        color: '#ffffff',
        offset: {
          x: 18,
          y: 62
        }
      },
      line: {
        offset: -1,
        opacity: .5,
        length: 8
      },
      points: {
        size: 0.2,
        radius: 0.7,
        opacity: 0.2
      }
    });
    // label.hide();
    labels.push(label);
    scene.add(label.group);
  });

  return labels
}
